package com.haizhi.bean;

// Generated 2016-8-15 17:44:37 by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Entity: 
 */
@Entity
@Table(name = "tb_section", catalog = "db_lemon3d")
public class TbSection implements java.io.Serializable {

	/** 
	 * ���id.
	 */

	private Integer sectionId;

	/** 
	 * �������.
	 */

	private String sectionName;

	/** 
	 * ��������.
	 */

	private int sectionPostNum;

	/** 
	 * ��������.
	 */

	private int sectionCommentNum;

	/** 
	 * ���շ�����.
	 */

	private int sectionTodayPostNum;

	private Set<TbPost> tbPosts = new HashSet<TbPost>(0);

	public TbSection() {
	}

	public TbSection(String sectionName, int sectionPostNum,
			int sectionCommentNum, int sectionTodayPostNum) {
		setSectionName(sectionName);
		setSectionPostNum(sectionPostNum);
		setSectionCommentNum(sectionCommentNum);
		setSectionTodayPostNum(sectionTodayPostNum);
	}

	public TbSection(String sectionName, int sectionPostNum,
			int sectionCommentNum, int sectionTodayPostNum, Set<TbPost> tbPosts) {
		setSectionName(sectionName);
		setSectionPostNum(sectionPostNum);
		setSectionCommentNum(sectionCommentNum);
		setSectionTodayPostNum(sectionTodayPostNum);
		setTbPosts(tbPosts);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "section_id", unique = true, nullable = false)
	public Integer getSectionId() {
		return this.sectionId;
	}

	public void setSectionId(Integer sectionId) {
		this.sectionId = sectionId;
	}

	@Column(name = "section_name", nullable = false, length = 30)
	public String getSectionName() {
		return this.sectionName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}

	@Column(name = "section_post_num", nullable = false)
	public int getSectionPostNum() {
		return this.sectionPostNum;
	}

	public void setSectionPostNum(int sectionPostNum) {
		this.sectionPostNum = sectionPostNum;
	}

	@Column(name = "section_comment_num", nullable = false)
	public int getSectionCommentNum() {
		return this.sectionCommentNum;
	}

	public void setSectionCommentNum(int sectionCommentNum) {
		this.sectionCommentNum = sectionCommentNum;
	}

	@Column(name = "section_today_post_num", nullable = false)
	public int getSectionTodayPostNum() {
		return this.sectionTodayPostNum;
	}

	public void setSectionTodayPostNum(int sectionTodayPostNum) {
		this.sectionTodayPostNum = sectionTodayPostNum;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbSection")
	public Set<TbPost> getTbPosts() {
		return this.tbPosts;
	}

	public void setTbPosts(Set<TbPost> tbPosts) {
		this.tbPosts = tbPosts;
	}

}
